﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.OracleClient;

namespace Projekt_GUI.Forms
{
    public partial class Mitarbeiter : Form
    {
        public Mitarbeiter()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox3.Text != "")
            {
                using (OracleConnection con = new OracleConnection("Data Source=" + Form1.CONFIG_DB_HOST + "; User Id=" + Form1.CONFIG_DB_USER + "; Password=" + Form1.CONFIG_DB_PASS))
                {
                    con.Open();
                    OracleCommand com = con.CreateCommand();
                    com.CommandText = "INSERT INTO Mitarbeiter VALUES(SQ_Mitarbeiter.NEXTVAL, '" + textBox3.Text + "', '" + textBox2.Text + "', '" + textBox4.Text + "', '" + textBox5.Text + "', '" + textBox6.Text + "', '" + textBox7.Text + "', '" + textBox8.Text + "', '" + textBox10.Text + "', '" + textBox9.Text + "')";

                    com.ExecuteNonQuery();
                }

                Close();
            }
        }

        private void Mitarbeiter_Load(object sender, EventArgs e)
        {

        }
    }
}
